package be.redo.converters;

import org.springframework.core.convert.converter.Converter;

import be.redo.abstractlayer.ServiceMarker;

public class AbstractLongToEntityConverter<Service extends ServiceMarker<Entity>, Entity>
		implements Converter<Long, Entity> {

	private final Service service;
	   protected AbstractLongToEntityConverter(Service service) {
	      this.service = service;
	   }

	@Override
	public Entity convert(Long primaryKey) {
		return service.read(primaryKey);
	}

}
